package com.bw.msg.mvvm.adpter;

import android.view.View;
import android.widget.ImageView;

import com.bw.msg.R;
import com.bw.msg.mvvm.model.entity.MessageEntity;
import com.bw.mvvm_comom.network.load.LoadImage;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

public class MessageAdapter extends BaseQuickAdapter<MessageEntity.Values, BaseViewHolder> {
    public MessageAdapter() {
        super(R.layout.item_msg);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, MessageEntity.Values values) {
        baseViewHolder.setText(R.id.msg_item_title,values.msg_title);
        baseViewHolder.setText(R.id.msg_item_value,values.msg_content);
        baseViewHolder.setText(R.id.msg_item_time,values.msg_time);
        ImageView imageView = baseViewHolder.getView(R.id.msg_item_img);
        LoadImage.loadMatchImg(values.msg_icon,imageView);

    }
}
